<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('presupuesto/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" id="formNuevo" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
   <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
         </td>
      </tr>
    </tfoot>
    <tbody>
     <?php echo $form->renderGlobalErrors() ?> 
     <tr>
     <th><?php echo $form['remove_it']->renderLabel() ?></th>
     	<td>
        	<?php echo $form['remove_it']->renderError() ?>
            <?php echo $form['remove_it'] ?>
        </td>
     </tr>
     <tr>
     <th><?php echo $form['fecha']->renderLabel() ?></th>
     	<td>
        	<?php echo $form['fecha']->renderError() ?>
            <?php echo $form['fecha'] ?>
        </td>
     </tr>
     <tr>
     <th><?php echo $form['cliente_id']->renderLabel() ?></th>
     	<td>
        	<?php echo $form['cliente_id']->renderError() ?>
            <?php echo $form['cliente_id'] ?>
        </td>
     </tr>
     <tr>
     
     <th><?php echo $form['vehiculo_id']->renderLabel() ?></th>
     	<td>
        	<?php echo $form['vehiculo_id']->renderError() ?>
            <?php echo $form['vehiculo_id'] ?>
        </td>
     </tr>
     
    </tbody>
  </table>
  <div id='conceptos'>
    <div>
      <table cellspacing="0" class="titulo">
        <thead>
          <tr>
              <th><?php echo __('Cantidad') ?></th>
  	          <th><?php echo __('Concepto') ?></th>
  	          <th><?php echo __('Precio Unit.') ?></th>
  	          <th><?php echo __('Descuento') ?></th>
  	          <th><?php echo __('Iva') ?></th>
  	          <th><?php echo __('Total') ?></th>
  	       </tr>
  	     </thead>
  	  </table>
  	</div>
	<?php include_partial('conceptos',array('form' => $form,
                                             'accion' => $accion,
                          )) ?>
  </div>
  <table>
    <tr>
      <th><?php echo $form['observaciones']->renderLabel() ?></th>
      <td>
      	<?php echo $form['observaciones']->renderError() ?>
        <?php echo $form['observaciones'] ?>
      </td>
     </tr>
  </table>
</form>

<script>
	$('input[type="text"]').focus(function() {
	    $(this).addClass("focus");
	    $(this).parent().parent().addClass("focustr");
	});
	$('input[type="text"]').blur(function() {
	    $(this).removeClass("focus");
	    $(this).parent().parent().removeClass("focustr");
	});
	$('textarea').focus(function() {
	    $(this).addClass("focus");
	    $(this).parent().parent().addClass("focustr");
	});
	$('textarea').blur(function() {
	    $(this).removeClass("focus");
	    $(this).parent().parent().removeClass("focustr");
	});
    $('select').focus(function() {
	    $(this).addClass("focus");
	    $(this).parent().parent().addClass("focustr");
	});
	$('select').blur(function() {
	    $(this).removeClass("focus");
	    $(this).parent().parent().removeClass("focustr");
	});
</script>